package com.jcfy.project.module.service.impl;

import java.util.List;
import com.jcfy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcfy.project.module.mapper.TAddressMapper;
import com.jcfy.project.module.domain.TAddress;
import com.jcfy.project.module.service.ITAddressService;

/**
 * 地址Service业务层处理
 *
 * @author jiangfeng
 * @date 2020-08-05
 */
@Service
public class TAddressServiceImpl implements ITAddressService {
    @Autowired
    private TAddressMapper tAddressMapper;

    /**
     * 查询地址
     *
     * @param addressId 地址ID
     * @return 地址
     */
    @Override
    public TAddress selectTAddressById(Long addressId) {
        return tAddressMapper.selectTAddressById(addressId);
    }

    /**
     * 查询地址列表
     *
     * @param tAddress 地址
     * @return 地址
     */
    @Override
    public List<TAddress> selectTAddressList(TAddress tAddress) {
        return tAddressMapper.selectTAddressList(tAddress);
    }

    /**
     * 新增地址
     *
     * @param tAddress 地址
     * @return 结果
     */
    @Override
    public int insertTAddress(TAddress tAddress) {
        tAddress.setCreateTime(DateUtils.getNowDate());
        return tAddressMapper.insertTAddress(tAddress);
    }

    /**
     * 修改地址
     *
     * @param tAddress 地址
     * @return 结果
     */
    @Override
    public int updateTAddress(TAddress tAddress) {
        tAddress.setUpdateTime(DateUtils.getNowDate());
        return tAddressMapper.updateTAddress(tAddress);
    }

    /**
     * 批量删除地址
     *
     * @param addressIds 需要删除的地址ID
     * @return 结果
     */
    @Override
    public int deleteTAddressByIds(Long[] addressIds) {
        return tAddressMapper.deleteTAddressByIds(addressIds);
    }

    /**
     * 删除地址信息
     *
     * @param addressId 地址ID
     * @return 结果
     */
    @Override
    public int deleteTAddressById(Long addressId) {
        return tAddressMapper.deleteTAddressById(addressId);
    }
}
